This section defines the image transcoder component functions.
Initiates an image transcoding sequence and specifies the input data format.
pascal ComponentResult ImageTranscoderBeginSequence (
ImageTranscoderComponent itc,
ImageDescriptionHandle srcDesc,
ImageDescriptionHandle *dstDesc,
void *data,
long dataSize);
The ImageTranscoderBeginSequence function specifies the format of source compressed image data in the srcDesc parameter. The image transcoder should allocate a new image description and return it in the dstDesc parameter. The new image description should be a completely filled out image description which is sufficient for correctly decompressing the data generated by subsequent calls to ImageTranscoderConvert .
Performs image transcoding operations.
pascal ComponentResult ImageTranscoderConvert (
ImageTranscoderComponent itc,
void *srcData,
long srcDataSize,
void **dstData,
long *dstDataSize);
The image transcoder component is responsible for allocating storage for the transcoded data, transcoding the data, and returning a pointer to the transcoded data in the dstData parameter. The size of the transcoded data in bytes should be returned in the dstDataSize parameter. The caller is responsible for disposing of the transcoded data using the ImageTranscoderDisposeData function.
The memory allocated to store the transcoded image data must not be in an unlocked handle. Even if the image transcoding operation can be performed in place, the transcoded data must be placed in a separate block of memory from the source data. The image transcoder component must not write back into the source image data.
The responsibility for allocating the buffer for the transcoded data has been placed in the transcoder with the intent that some hardware manufacturers may find it useful to place the transcoded data directly into on-board memory on their video board. If the transcoding operation is being performed on a QuickTime movie, the transcoded data pointer will be almost immediately passed on to a decompressor. If the decompressor is implemented in hardware, performance may be increased because the transcoded data is already loaded onto the decompression hardware.
pascal ComponentResult ImageTranscoderDisposeData (
ImageTranscoderComponent itc,
void *dstData);
When the client of the image transcoder component is done with a piece of transcoded data, ImageTranscoderDisposeData must be called with a pointer to the transcoded data. The image transcoder component should not make any assumptions about the maximum number of outstanding pieces of transcoded data or the order in which the transcoding data will be disposed.
Ends an image transcoding sequence.
pascal ComponentResult ImageTranscoderEndSequence (ImageTranscoderComponent itc);
ImageTranscoderEndSequence is called when there are no more frames of data to be transcoded using the parameters specified in the previous call to ImageTranscoderBeginSequence . After calling this function the component will either be closed or receive another call to ImageTranscoderBeginSequence with a different image description. (For example, the dimensions of the source image may be different.)
| Previous | Chapter Contents | Chapter Top |